nwnfandomcom-20200213-history
Spells.2da
The spells.2da file is the .2da that nominally defines the spells available in the game. While it does define the spells available to spellcasters, it also covers many other actions, such as most feats that require activation, monster abilities, and item abilities. For simplicity, these are often collectively called "spells" when in the context of custom content. Each row of this file corresponds to one of these generic "spells". The columns of this file define how each spell can be used. This covers such things as valid targets, animations, the script to fire, and whether or not casting the spell is inherently considered a hostile act. Also covered is the definition of which classes have access to each spell by default (not counting special cases like domains). Traditional spells are defined by adding them to this file and assigning them to classes. Other entries in this file are used only when specifically referenced by something, such as the "SPELLID" column of feat.2da. In this respect, this file is the central location for connecting in-game actions to scripts. __TOC__ Column notes Both the MetaMagic field and TargetType fields are bit fields. The below tables show the hexadecimal values that are added together to get the values for use in the .2da file. For an online calculator for these columns, see the external links at the end of this article. | width="20" | | |} A value of 0x40 can be used as a target type for triggers, encompassing both trap triggers that have been discovered and area transition triggers, but this does not work very well. Hordes of the Underdark specific change: All player-castable spells need to have bit 0x08 (target items) set in the target type to allow them to work with the crafting system (for brew potion, craft wand, and scribe scroll). The responsibility for blocking spells from targeting items other than a blank potion, wand, or scroll has been shifted to the crafting routines. To indicate whether or not a spell is allowed to target items outside the crafting system, the "CastOnItems" column in des_crft_spells.2da needs to be used. General notes * It appears there is a limit of 255 to the number of spells which can be put into class spell book. Attempting to log in with a character with more spells than this will crash the server (or crash the game in single player). This limit applies only to the actual spells known by a character, not the spells available on level up. Since radial spells — such as protection from good and protection from evil — count as one spell in the spell book — protection from alignment, for this example — adding spells as radial options is one way around this limitation. *BioWare followed a naming convention for their spell scripts, as detailed in the following table. References External links * Spells.2da by sLsR — a calculator for the bitfield columns plus an illustrated guide to the various visuals and sounds available for several other columns. Category:2da